from ReidTools.FeatureMapTools import getFeatureMap
import torch
from parameters import para
import os, glob

model = torch.load("ReidTools/model_cpu.pt").to(torch.device("cuda"))

print(model)


dataPath = para["CommonDataPath"]
print(dataPath + "*/*.jpg")
imgs = glob.glob(dataPath + "*/*/*.jpg")
imgs = [i.replace("\\", "/") for i in imgs]
# print(imgs)
for i in imgs:
    savePath = i[:i.rfind("/")]
    # print(savePath)
    print(i, savePath)
    getFeatureMap(model, "cuda", i, savePath)


